package br.cs.correspodente.DAO;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import br.cs.correspodente.beans.Telefone_Vendedor;
import br.cs.correspodente.conexao.FactoryConnection;


public class Telefone_VendedorDAO {
	private final static String sqlAdd = "INSERT INTO Vendedor VALUES(0,?,?);";
	
	public void add(Telefone_Vendedor telefone) throws SQLException, ClassNotFoundException {
		Connection con = FactoryConnection.getInstance().criaConexao();
		PreparedStatement stm = con.prepareStatement(sqlAdd);
		stm.setString(1,telefone.getTel());
		stm.setInt(1,telefone.getVendedor().getId());
		stm.execute();
		FactoryConnection.getInstance().closeConexao(con, stm);
	}
	
}
